package de.baumann.browser.present

import de.baumann.browser.api.OdinObserver
import de.baumann.browser.api.net.vo.Member
import de.baumann.browser.base.BasePresenter
import de.baumann.browser.iview.INodeMembersView
import de.baumann.browser.model.NodeModel

class NodeMemberPresenter :BasePresenter<INodeMembersView>(){

   fun members() {
        NodeModel().members(view.getNodeId())
                .subscribe(object : OdinObserver<List<Member>>(view) {
                    override fun onSuccess(data: List<Member>?) {
                        if (view != null) {
                            view.setMembers(data)
                        }
                    }
                })
    }

}